<?php
/**
 * 空控制器
 */
namespace app\api\controller;
use app\common\controller\Api;
use \think\Loader;
class Error extends Api{
    public function _empty(){
        return $this->route();
    }
    /**
     * @name 解析路由
     */
    public function route(){
        $alias = S('route_alias');
        if(!$alias){
            $file = join(DIRECTORY_SEPARATOR, array(APP_PATH, 'api', 'apiList.php'));
            $alias = include $file;
            if(!empty($alias)){
                S('route_alias',$alias);
            }
        }
        if(array_key_exists($this->api,$alias)){
            return Loader::action($alias[$this->api],$this->data);
        }else{
            return getApiErrorCode('00404');
        }
        
    }
 }